package dao;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

public class BaseDao {

    protected SqlSessionFactory sqlSessionFactory;

    protected BaseDao() {
        String resource = "config/mybatis-configuration.xml";
        InputStream inStream = MessageDao.class.getClassLoader().getResourceAsStream(resource);
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(inStream);
    }

}
